code readability improvements and bugfix with postprocess_main getting called