a few refactorings :rage1: