Delegate resource handling out of main class