cleaning up code.
refactoring...