move rest commands into separate class