major refactoring based on discussions with iSB tech staff