Refactor layout of resources