splitting and optimizing