removed extra js files
refactored whole thing for better readability & understandability