Move require out of method