Refactoring: split all files, not compiled into one, temporary set some variable to global