Code refarctoring after run-time bug fix.