cleans up and adds spec to per_page option