Include all BPR code, remove useless stuff, and optimise