Improve use of internal vars