initial refactor