clean up bp code