Update algorithm for creating toolbar on viewparts; Clean code