reorganize, improve output