Remove uneeded code
Fix tests