Some improvement suggestions

Check the commit messages/diffs for more info