modify database connection;
modify redis queries;
clean up code