move paping logic to base