Slight code refactor