small base code refactor