brick refactoring