refactoring.. once again.. things are getting weird..