many changes for code consistency