Remove some hard-coded elements and duplication