Optimized background thread
Updated version code