More Refactoring code