refactored hmr in seperate file and updated readme