prerefactor
minor refactoring