started to remove redundant code and import it instead