Renaming functions for easy understanding and removing unnecessary variables