test basic database insert refactored code