better structure for command generation