Small code improvments