bp: code cleanup