Refactors and comments