Refactor functions parameters