make a main file and sub files with templates, classes and functions
get refactored file working