refactoring.. fixes..