refactored application controller and its tests

Signed-off-by: Keri Clowes <kerilyn.clowes@gmail.com>
Signed-off-by: Aubrey Howell <simplyaubs@gmail.com>