insert/2 can now handle if account already exists and some refactoring