minor refractoring for better code style