remove hard coding in dateloading, polish code