[#1934] refactor ireg to handle resource hierarchies if root is not specified
[#1880] style the file