separate things to modules, fix some warnings
more modularization