This entire sequence could use cleaned up.