fixes + refactors