Re-organize rest class