replaced scanCommands with addCommands, that still use static methods for the maximum performances