Does some little refactoring