Refactoring castle.