Remove some dup code