Reducing dup code