Move observatory codes generation to private method