refactoring..adds speed..