basic database implamentation / clean up