This 3 line sequence should be DRY-ed up.