func calls refactored