small refactor, common fixes, typos...