Simplified query and added ModelUtil.getPName method.

Change-Id: I4760994838d7972fdafdf5fcfe2f73f7ce0a909c