Dynamically create some similar methods to avoid duplication