Cleanup and formatting JS