Improve install scripts, refactor structors and overall modularity