start refactoring to parse resource from file