Refactoring

Refactoring code