some celanup/refactoring