cleaned up code and prepared app template