Refactoring some code related to the Guild menu