refactored checkin index js