Remove unused functions and unnessecary stuff