Clear code, add -M option, change select of databases