reogranized codeflow
display fixes