Major refactoring to enum and tests for contacts