Moves doorbell function to a factory and creates a file for directives