move code to lib/ and bin/