Clean up to use streams api.