follow good JS practices for functions