Contact Page javascript refactoring