Did a little refactoring