Refactor for readibility/maintainability