main: refact the main method to class, make it easy to read and modify