refactor rules, pad with 0