Use more elegant and flexible way to process commands
typedef command functions, making it more readable