Cleaning up code
merging add, query, and utils