Do some little refactorings