big refactoring, add rules file for routes