Remove old code and cleanup