moved util services to plain private functions; merged ui and sharedState