Some cleanup and added docs