Renaming some functions and style changes