aligned code to new style