generalize extraction method for any scale