Refactor yet again