variable trend scale
refactor and cleanup