Refactoring the codez