small refactors removed unused vars