almost there on rest refactor