Small refactoring of class initialization