Fix code style, revamp CMS variable getter