Remove unnused code and tests