refactor function visibility