mayor refactor