factor out chains from bricks, will be added on top later