refacturing, small fixes.