Code cleanup + docs