clean up
create tables at the right place
add login_required