Move logic from application to module