Move eshell specific code into right place