a bit of refactoring
much better...