Refactoring directive and adding email regex validation check

Mainly just trying to clean the redundant if-statements that could be expressed with ternary statements.