Refactors code for readability