added loadOnHDFS method plus refactor