Refactoring code: Xml buider and constant hash