resource usage fixes