cleanup

code cleaned, some small improvements