Add 'optional' attr to arguments, refactor