feel free to do the refactoring. for me it was simpler to rewrite it.