refactored code and using statements, should work more or less completely.