More refactoring of Hadoop installation script