master refactor