Counting Bp: move internal classes to source file