Factoring and Expanding Linear Expressions