Code cleanup, naming updates and comments added