Updated tests and removed unused code