refactored structure for modularization