Motion trail framework added + refactoring