Refactor to read sql from files