refactor to modular