versio 2 (extract method)