Move contains function to separate component and added as dependency