Cleaning up the code

Signed-off-by: Gavin Guo <gavin.guo@canonical.com>