Use class and objects to rewrite the project