improvements using JS