Code cleanup + minor updates