Refactor contact.js

Couldn't help it when I saw how it was done before.