refactor, minor changes, ~1.5h