Lightweight JS pill collection