Handle table already exists properly
Modulearize code