Use file lookup api to simplify logic