Modular refactor

GOGOGO!