Update query method with lesser code lines (will want some test)