Some refactoring (maybe to the better..)