Add withApplication (close #26)