final logic improvements