improved readability of js code