cleaned up internal API