refactored brick mapping