Move code into lib/.