Add a custom strategy with simple heuristics, clean up code