add db install scripts
minor clean in code