modularize self bloodbag script