best refactor yet