Simplifying js