Implemented resource management.