Code cleanup and some documentation strings