Modularized code

- Modularized code for easier extending and handling
- Added functionality to pass in data source and data filename
- Optimized performance