Moved operations outside of sync block