improve modularization