major code cleanup. removed tons of unused code