Fixes/refactors