Refactors all code
Updates documentation