Cleaned up JS structure.