Updating docs and simplifying a lot of code