Update: More readable refactor