Hopefully last refactoring