Code cleanup
Refactorings