consolidated initialization and some reformatting for better readability