refactoring to new system