Use passed in Application object and don't assume the class has one 

Signed-off-by: Gawain Lynch <gawain.lynch@gmail.com>