refactor to help with slow android devices.