Began refactor