Refactored codebase towards strategy pattern.