refactor for modularness