merged badrcptto_pattern into badrcptto refactored into smaller methods added unit tests for each method