refactoring for renderer-UI separation and cleaner style spec.