Registering routes moved to method