More documentation & remove some unnecessary code