semi clean implementation of commands