Modularized code by controller, directive, and services