main thread phase 1
A little beautifing works