Refactored the util.getPart method