refactor, trying to limit exposed functions