refactor with breeze integrated, instead of Scalala