refactor optimizer
refactor optimizer