Created by: meguiraun
some the fixes from the wip pr (I removed the ones that need more work and some agreement)