splitting/renaming source code for better clarity