extract method for better readability