Split into resources and resolved resource leak.