improved logging and console output