after some personal refactoring