Renamed functions in CamelCase format, some code cleanup