Rework command to work with new API