Move constant expansion from function to method