Refactors to better use trig