Change some of threading to synchronous methods