Refactored period, now can be passed as an argument