Improved hydrogen storage properties in Mg-based thin films by tailoring structures