more readable, fix indentation, jslint errors