Cleaner and more abstract way of implementing elements