refactored controllers and directives to be in individual files