try to refactor parts