More refactoring--added task registering with app.