PupilFrame refactored