added some fixes to the whole app, and converted template into directive