refactoring the gordon glue
refactored database interactions