refactoring to routeable api