Refactoring:
* add "common.h" to define common objects

Alteration:
* add exit code for invalid argument