refactoring application controller methods. -- should also move these out of here..
cleaning up the templates a bit.