Refined the commands and added logging messages