declare functions instead of using anonymous route functions