Refactors transform code, stores coordinates on elements.