revise program structure and classes