Modeling level alignment at interfaces in molecular junctions