renamed some functions & types