merged production code with feature-email-validation branch, testing to be done