cleaner way of implementing things