bsp: get rid of all inner functions and all warnings