bunch of refactoring work on bulletml