minor fixes & cleaning code