Create tables and clean up code