removed a lot of unused code