small code improvments