improved console output and code cleaning