refactoring code so that it's cleaner to read.
Merge pull request #1 from felipesanches/use2d_primitives

refactoring code so that it's cleaner to read.