abstracted out common command functions