refactoring and cleaning up function names