Various technical debt

See commit messages