improve output; clean code