Refactor/rename functions