setReady doesn't make sense here because insertBefore and appendChild are synchronous operations thought