merged Amit's changes to remove hard coding