1. Move select domain to scan logic to domain object
2. Create tests for it

See #1 and #3