#2: small code improvements