Simplified javascript