cleaned up application controller