organize code
remove debug messages