guilde refactoring