Delete main method, add some code for lib