Wholly refactored