rethink 'end'. rethink current value handling. refactoring