Add xhr method, flatten layout indentation