[refactor] make the keyPath optional, not the location