Code cleanup and broken export functionality