fix cyclic require, redefined methods and other warnings