Performance bug fix.
simple refactor and cleaning