redundant code snippet