Cleanups and documenation