Refactor hypermedia