better synchronization and threads use