crud done for bubble, but lots of replicated code that needs streamlining