Changes to things

Static functions, removed obselete/redundant code, setting out etc