Moved the db methods to transactional wrapper, handle org deletion