Some refactor, some cosmetics