Adding handy extract function