Port util classes from designer

- ported a couple utility classes from Designer