Functional version for all commands