refactor UG logic for IPOS