Remove boilerplate

- use a function to create commands