Tidy up code and add BRICs button