Refactor code to make future startup notification 'launch with attributes' feature work