Move file require out of method