Fix codestyle and clean up no longer needed pieces of code