refactor contacts controller