preform refactoring