Refactor language courses code