Renamed some functions
minor refactoring