optimize + fixes + checks