code cleanup
moved classes and functions to separate files to not have on monolithic main file