Cleaner js code