Rewrite for BS3.0

Signed-off-by: Kalman Olah <kalman@inuits.eu>