Remove duplicated code for including scripts