refactored names of functions as per suggestions