Brick size auto-adjust + minor polishments/refactors