code structure improvement