refactor function signatures