check whether an element is available to add
remove unnecessary imports