Code cleanup for public release