Small code cleaning

Preparing for a code rewrite soon.