Fixed double 'initialize' call. Minor refactoring