refactor load properties (autoclosable)