Added specific function for processing commands