optimization and post processing