Move more logic to js and validate ad size at first