Avoid spinning threads, should be refactored using wait/notify