Re-factored codebase for updated techniques and better reading.