Some refactoring /cc @jbeemster