Magic values replaced by constant variable. Added truncateOldData method.