contacts - lots of stuff - cleanup and refactoring