fixed lint problems.
refactored.