General refactor and find period by id