mount scripts: improved the code