chains and optimization