remove unused code
improved output methods