extract methods, share state. Refactor