refactored account and contact controller