refactor routes; use middleware; use components