Mayor source code and interface refactoring