Refactored yet again