refactored the database calls to use dictionaries instead of passing arguments to the functions