Simplify js functions.