move commands related stuff out