Refractor code, update installation instructions