Renamed some functions for better clarity