minifix
Fixes and refactors